package com.spzx.user.api.factory;

import com.spzx.common.core.domain.R;
import com.spzx.user.api.RemoteUserAddressService;
import com.spzx.user.api.domain.UserAddress;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 服务降级处理
 *
 */
@Component
public class RemoteUserAddressFallbackFactory implements FallbackFactory<RemoteUserAddressService>
{
    @Override
    public RemoteUserAddressService create(Throwable cause) {
        return new RemoteUserAddressService() {
            @Override
            public R<UserAddress> getUserAddress(Long id, String source) {
                System.out.println("getUserAddress降级。。。");
                return null;
            }
        };
    }
}